package com.bjpowernode.controller;

import com.bjpowernode.result.Result;
import com.bjpowernode.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.math3.stat.descriptive.summary.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class ProductController {

    private final ProductService productService;

    @GetMapping("/api/product")
    public Result getProducts() {
        List<Product> productList = productService.getProducts();
        return Result.OK(productList);
    }
}
